package com.lightsaber.trade.as.dao.reta;

import org.springframework.stereotype.Repository;
import org.springside.modules.orm.Page;

import com.lightsaber.trade.as.entity.reta.Product;
import com.lightsaber.trade.core.common.util.CurrentUser;
import com.lightsaber.trade.core.dao.BaseDao;

@Repository
public class ProductDao extends BaseDao<Product, String> {

    public void findPage(Product product, Page<Product> page) {
        eq("organization",CurrentUser.getOrg());

        if (product != null) {
            eq("type", product.getType());
            like("code", product.getCode());
            like("name", product.getName());
        }

        findPage(page);
    }
}
